package com.onec.service.api.content;

/**
 * 正则表达式类
 *
 * @author ONEC
 */
public class PatternUtil {

    /**
     * 姓名，替换规则："(.{1})(.*)(.{0})" ："$1**$3"
     */
    public static final String REG_NAME_S = "(.{1})(.*)(.{0})";
    /**
     * 是不是中文：
     */
    public static final String REG_CHINA_ = "[\u4e00-\u9fa5]";
    /**
     * 包含六位："(.{" + (6) + "})"全部替换："******"
     */
    public static final String REG_SMS_CODE = "(.{" + (6) + "})";
    /**
     *
     */
    public static final String REG_CVV_DATA = "(.{" + (4) + "})";
    /**
     * "(.{" + (len < 12 ? 3 : 6) + "})(.*)(.{4})", "$1****$3"
     */
    public static final String REG_CARD_ID = "(.{" + (1 < 12 ? 4 : 6) + "})(.*)(.{4})";

    /**
     * 正则邮箱
     */
    public static final String EMAIL = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
    /**
     * 正则手机
     */
    public static final String PHONE = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$";
    /**
     * 正则手机
     */
    public static final String REG_PHONE = "/^(13[0-9]{9})|(18[0-9]{9})|(16[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/";
    /**
     * 正则身份
     */
    public static final String REG_ID_CARD = "^(\\d{6})(\\d{4})(\\d{2})(\\d{2})(\\d{3})([0-9]|X)$";
    /**
     * 正则url
     */
    //public static final String REG_URL = "/http[s]?:\\/\\/([\\w.]+\\/?)\\S*/";
    public static final String REG_URL = "(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]";
    public static final String REG_NAME = "^[a-zA-Z]\\w{5,17}$";
    /**
     * 交易金额
     */
    public static final String AMOUNT_ = "/^(?!(0[0-9]*$))[0-9]+[.]*[0-9]*$/";

    /**
     * 8-16 位数字字母组成密码
     */
    public static final String PASSWORD_ = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$";


}
